package 工具类.demo1;

import java.util.ArrayList;

public class studentUtil {
    private studentUtil(){}
    public static int getMaxStudentAge(ArrayList<student> list){
        int max=list.get(0).getAge();

        for (int i = 1; i < list.size(); i++) {
            if(max<list.get(i).getAge()){
                return list.get(i).getAge();

            }
        }
        return max;
    }
}
